<?php 
include("conexion.php");
$tipoper=$_POST['tipoper'];
$numdoc=$_POST['numdoc'];

$sqlclie=mysql_query("select * from cliente where  numdoc='$numdoc' and tipper='$tipoper'", $conn) or die(mysql_error());
$row=mysql_fetch_array($sqlclie);
if (!empty($row) ){
	 if ($row['tipper']=="N" and $row['numdoc']!=""){
		 include("mostrarclientelib.php");
		}else{ 
		    if ($row['tipper']=="N" and $row['numdoc']==""){
		 echo"<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px;'>No se encontro al cliente :</span><a onClick='newclient()'> <img src='iconos/newcliente.png' width='134' height='28' border='0'></a><input type='hidden' name='codclie' id='codclie' value=''   />";
		      }
		  } 
	 
   if ($row['tipper']=="J" and $row['numdoc']!=""){
		 include ("mostrarempresalib.php");
		}else{ 
		    if ($row['tipper']=="J" and $row['numdoc']==""){
		 echo"<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px;'>No se encontro la empresa :</span> <a onClick='newclientempresa()'><img src='iconos/newcliente.png' width='134' height='28' border='0'></a><input type='hidden' name='codclie' id='codclie' value=''/>"; 
		      }

		  }
	
}else{
    if ($tipoper!="N"){
	  echo"<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px;'>No se encontro la empresa :</span> <a onClick='newclientempresa()'><img src='iconos/newcliente.png' width='134' height='28' border='0'></a><input type='hidden' name='codclie' id='codclie' value=''   />"; 
	 }else{
	  echo"<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px;'>No se encontro al cliente :</span><a onClick='newclient()'> <img src='iconos/newcliente.png' width='134' height='28' border='0'></a><input type='hidden' name='codclie' id='codclie' value=''   />";
	 }
}

 
?>
